package cn.Testr;

import com.sun.org.apache.xml.internal.utils.ListingErrorHandler;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

/*本类用于练习迭代*/
public class Foriii {
    public static void main(String[] args) {
        List<String> arrList = new ArrayList<>();
        arrList.add("1");
        arrList.add("2");
        arrList.add("3");
        arrList.add("4");
        arrList.add("5");
//        String[] a ={"1","2","3","4","5","6","8"};
//        print(a);
        Iterator<String> it = arrList.listIterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }

        int[]b = {1,2,3,54,5,4,7,8,5,4,2,5};
        char[]c={'1','2','3','4','8','5'};
        print(c);
        for(int sdaf:b) {
            System.out.println(sdaf);
        }

    }

    private static void print(String[] mmm) {
        for (int i = 0; i <mmm.length ; i++) {
            System.out.println(mmm[i]);
        }
    }

    private static void print(char[]gfu) {
        for (int i = 0; i < gfu.length; i++) {
            System.out.println(gfu[i]);
        }
    }



}

